<?php
// +----------------------------------------------------------------------
// | Qbt CMS Plugin
// +----------------------------------------------------------------------
// | Copyright (c) 2012-2018 http://www.qbt8.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: xg <develop02@qbt8.com>
// +----------------------------------------------------------------------
namespace plugins\qbt_alisms\service;

use plugins\qbt_alisms\controller\SendSmsController;
use think\Db;

class AliSmsService extends Controller
{
    /**
     * @param $data
     */
     public function send_msg($data){
         $obj = new SendSmsController();
         $result = $obj->sendSms($data['phoneNum'],$data['temp_param'],$data['tempCode']);
         if ($result){
             $arr['phone'] = $data['phoneNum'];
             $arr['code'] = $data['temp_param']['code'];
             $arr['state'] = 0;
             $arr['create_time'] = time();
             Db::name('alisms_log')->insert($data);
         }
     }
}